import request from '@/utils/request'

// 查询出入库单(头)列表
export function listTransaction(query) {
  return request({
    url: '/system/transaction/list',
    method: 'get',
    params: query
  })
}

// 查询出入库单(头)详细
export function getTransaction(txNo) {
  return request({
    url: `/system/transaction/${txNo}`,
    method: 'get'
  })
}

// 新增出入库单(头)
export function addTransaction(data) {
  return request({
    url: '/system/transaction',
    method: 'post',
    data
  })
}

// 修改出入库单(头)
export function updateTransaction(data) {
  return request({
    url: '/system/transaction',
    method: 'put',
    data
  })
}

// 删除出入库单(头)
export function delTransaction(txNo) {
  return request({
    url: '/system/transaction/' + txNo,
    method: 'delete'
  })
}